import type { RouteRecordRaw } from "vue-router";
import Layout from "@/layout";

const baseRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "layout",
    redirect: "/home",
    component: Layout,
    children: [
      {
        path: "/home",
        name: "home",
        meta: {
          title: "系统首页"
        },
        component: () => import("@/views/home.vue")
      },
      {
        path: "/personal/info",
        name: "PersonalInfo",
        meta: {
          title: "个人资料"
        },
        component: () => import("@/views/personal/info.vue")
      },
      {
        path: "/personal/pwd",
        name: "PersonalPassword",
        meta: {
          title: "修改密码"
        },
        component: () => import("@/views/personal/pwd.vue")
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    meta: {
      title: "登录"
    },
    component: () => import("@/views/login.vue")
  },
  {
    path: "/error/403",
    name: "error403",
    meta: {
      title: "错误403"
    },
    component: () => import("@/views/error/403.vue")
  },
  {
    path: "/error/404",
    name: "error404",
    meta: {
      title: "错误404"
    },
    component: () => import("@/views/error/404.vue")
  },
  { path: "/:catchAll(.*)", redirect: "/error/404" }
];
export default baseRoutes;
